/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package us.oh.k12.wkw.robot.command;

/**
 *
 * @author Team4145
 */
public class DriveToggleXPidCmd extends CommandWithTimeout{
    
    
    public DriveToggleXPidCmd() {
        super("DriveToggleXPidCmd", 5);
        this.requires(this.getDriveSystem());
    }

    protected void initialize() {
        
         this.getDriveSystem().toggleXTargetPidEnabled();
         
    }

    protected void execute() {
       
    }
    
    protected void interrupted() {
        
        this.getDriveSystem().disableXPid();
        
        System.out.println("X-Pid interrupted");
    }
    
    protected void end() {
        
        this.getDriveSystem().disableXPid();
        System.out.println("X-Pid ended");
    }

    public boolean isFinished() {
        return (this.getDriveSystem().isXOnTarget() || super.isFinished());
    }
}

